package com.qf.service.impl;

import com.qf.dao.AddressMapper;
import com.qf.entity.Address;
import com.qf.service.AddressService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author chen
 * @version 1.0
 * @date 2019/10/24 19:45
 */
@Service
public class AddressServiceImpl implements AddressService {
    @Resource
    private AddressMapper addressMapper;
    @Override
    public int insertAddress(Address address) {
        if (address.getAddressstatus()==1){
            addressMapper.update();
        }
        int i = addressMapper.insertSelective(address);
        return i;
    }

    @Override
    public int deleteAddress(Integer addressId) {
        int i = addressMapper.deleteAddress(addressId);
        return i;
    }
}
